package personnel.department.dao.entity;

import java.text.ParseException;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.commons.lang3.time.DateUtils;

@Entity
@Table(name="retraining")
public class Retraining implements UniqueObject {

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="id")
	private Long id;
	
	@Column(name="speciality")
	private String speciality;
	
	@Column(name="date_retraining")
	private Date dateRetraining;
	
	@ManyToOne(cascade=CascadeType.ALL)
	@JoinColumn(name="employee_Id")
	private Employee employee;
	
	public Retraining() {
	}
	
	public Retraining(List<Object> params) {
		this.speciality = (String) params.get(0);
		this.dateRetraining = (Date) params.get(1);
	}

	public Long getId() {
		return id;
	}

	public String getSpeciality() {
		return speciality;
	}

	public Date getDateRetraining() {
		return dateRetraining;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public void setSpeciality(String speciality) {
		this.speciality = speciality;
	}

	public void setDateRetraining(Date dateRetraining) {
		this.dateRetraining = dateRetraining;
	}

	public Employee getEmployee() {
		return employee;
	}

	public void setEmployee(Employee employee) {
		this.employee = employee;
	}

	
}
